$(document).ready(function () {
    $('.btn').on('click', function () {
       var addBtn = $(this);
       var itemId = addBtn.attr('id');

        $.ajax({
            data: {
                itemId: itemId,
            },
            url: 'http://localhost:8080/mypetstore/addAJAX',
            type: 'POST',

            success: function (res) {
            },
            error: function (res){
            }
        });
    });
});